//
//  MainGameScene.h
//  ProjectL
//
//  Created by Nguyen Tan Loc on 8/17/13.
//  Copyright (c) 2013 Nguyen Tan Loc. All rights reserved.
//

#import "CCLayer.h"
#import "Box2D.h"
#import "GLES-Render.h"
#import "LevelManager.h"
#import "MainGameUI.h"


typedef enum
{
    sMG_SUMMON = 0,
    sMG_PREPARING,
    sMG_JAILBREAKING,
    sMG_STARTING,
    sMG_ENDING,
} MAIN_GAME_STATE;

@interface MainGameScene : CCLayer <UIAlertViewDelegate>
{
    MAIN_GAME_STATE mState;
    
    NSArray *mListPath;
    NSArray *mListBomb;
    NSArray *mListLazer;
    NSArray *mListEnergy;
    NSArray *mListBouncBall;
    NSArray *mListTutorial;
    
    DarkFog *mDarkFog;

    MainGameUI *mMainGameUI;
    CCSpriteBatchNode *mGlobalBatch;
    
    // resume for shop
    BOOL mIsShopJustClose;
    float mShakyTime;   // shake when bomb explode
}

@property (nonatomic, assign) MainGameUI *_mainGameUI;
@property (nonatomic, assign) DarkFog *_darkFog;
@property (nonatomic, readonly) MAIN_GAME_STATE _mainGameState;
@property (nonatomic, assign) CCSpriteBatchNode *_globalBatch;
@property (nonatomic, assign) BOOL _isShopJustClose;

+(CCScene *) scene;
+(MainGameScene *) getInstance;
-(void) handleCollision:(b2Fixture *)fixtureA fixtureB:(b2Fixture *)fixtureB;
-(void) replay;
-(void) nextLevel;
-(void) pause;
-(void) resume;
-(PNode *) getUserNode;
-(PLine *) getUserLine;
-(void) endGame:(ENDGAME_TYPE)type;
// objective-C
@end
